#!/bin/sh
#set -x

# (default) parameters
n=1000
m=1000
x=1

# take arguments as parameters n, m and the xth tester
[ -n "$1" ] && n=$1
[ -n "$2" ] && m=$2
[ -n "$3" ] && x=$3

# other parameters
group=q_student
minutes=3
nodes=1
cores=32
program=build/bin/merge${x}_tester
repetitions=10
check=

# parallel iterations
for i in $(echo -n "2 4 8 11 16 32"); do
	# echo 
	echo "srun -p $group -t $minutes -N $nodes -c $cores $program -n $n -m $m -p $i -r $repetitions $check; # parallel $i cores"
	srun -p "$group" -t "$minutes" -N "$nodes" -c "$cores" "$program" -n "$n" -m "$m" -p "$i" -r "$repetitions" "$check";
done;

# sequential run
echo "srun -p $group -t $minutes -N $nodes -c $cores $program -n $n -m $m -s -r $repetitions; # sequential run"
srun -p "$group" -t "$minutes" -N "$nodes" -c "$cores" "$program" -n "$n" -m "$m" -s -r "$repetitions";
